<!DOCTYPE html>
<html>
<head>
    <base href="/">
    <title>用户注册</title>
    <script src="static/js/global-functions.js"></script>
    <style>
        /* 复用登录页样式 */
        .container { max-width: 400px; margin: 50px auto; padding: 20px; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
        .form-group { margin-bottom: 15px; }
        input { width: 100%; padding: 8px; margin-top: 5px; }
        .btn-register { background-color: #007bff; color: white; padding: 10px 20px; border: none; cursor: pointer; width: 100%; }
        .login-link { text-align: center; margin-top: 15px; }
    </style>
</head>
<body>
    <div class="container">
        <h2>系统初始化，请设置管理员用户（admin）的密码</h2>
        
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                <ul class="flashes" style="color:red">
                {% for message in messages %}
                    <li>{{ message }}</li>
                {% endfor %}
                </ul>
            {% endif %}
        {% endwith %}

        <form method="POST" action="{{ url_for('admin_init') }}">
            
            <div class="form-group">
                <label>密码：</label>
                <input type="password" name="password" required minlength="6">
            </div>
            
            <button type="submit" class="btn-register">立即设置密码</button>
        </form>
    </div>
    
</body>
</html>